package com.nfzm;

import com.alibaba.fastjson2.JSONObject;
import com.nfzm.entity.NfzmArticle;
import com.nfzm.tools.HttpTool;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

public class Demo {
    public static void main(String[] args) throws Exception {

        String s ="\"大家好，我是拔刀刘，这次Coze提效大航海的教练。\\n\\n目前带领2300多名船员，还在海上驰骋。我在这里也用自己的一个案例，为咱们不会技术的众多小伙伴（包括我）打打气，在AI时代，借助工具，即使不会编程，也能快速制作出一款产品。\\n\\n<e type=\\\"text_bold\\\" title=\\\"%E8%87%AA%E5%8A%A8%E6%80%BB%E7%BB%93%E5%85%AC%E4%BC%97%E5%8F%B7%E5%86%85%E5%AE%B9%EF%BC%8C%E5%AE%9A%E6%97%B6%E6%8E%A8%E9%80%81%E5%88%B0%E5%BE%AE%E4%BF%A1%EF%BC%88%E9%99%848000%E5%AD%97%E5%AE%8C%E6%95%B4%E5%AE%9E%E6%93%8D%E6%95%99%E7%A8%8B%EF%BC%89\\\" />\\n\\n本文主要介绍了：\\n\\n1、需求分析\\n2、工作流拆解的方法\\n3、搭建这个工作流的详细步骤，1比1复刻你也可以做出一个相同的bot\\n4、关于如何用AI搜索查询自己需要的解决方案\\n\\n另外，不管你有没有报名这次的Coze提效大航海，我建议你都去看看这次的航海手册，<e type=\\\"text_bold\\\" title=\\\"%E7%9C%8B%E6%89%8B%E5%86%8C%E5%8F%AF%E8%83%BD%E8%8A%B12%E4%B8%AA%E5%B0%8F%E6%97%B6%EF%BC%8C%E4%BD%86%E6%98%AF%E6%9C%AA%E6%9D%A5%E5%8F%AF%E8%83%BD%E5%B8%AE%E4%BD%A0%E8%8A%82%E7%9C%81N%E4%B8%AA2%E5%B0%8F%E6%97%B6%E7%9A%84%E6%97%B6%E9%97%B4%E3%80%82\\\" />\\n\\n\\n飞书原文：\\n<e type=\\\"web\\\" href=\\\"https%3A%2F%2Fv0bko2tq65.feishu.cn%2Fdocx%2FFhA7d1HqYo2SqPxgz9KcLZ7un6c%3Ffrom%3Dfrom_copylink%26b3x5%3D1\\\" title=\\\"https%3A%2F%2Fv0bko2tq65.feishu.cn%2Fdocx%2FFhA7d1HqYo2SqPxg...\\\" />\"\n";
        String d = URLDecoder.decode(s,"utf-8");
        System.out.println(d);
        String a = "的人";
        System.out.println(URLDecoder.decode(a,"utf-8"));
    }

    private static void fun3() {
        String chineseChar = "国";
        try {
            byte[] bytes = chineseChar.getBytes("GBK");
            for (byte n : bytes) {
                System.out.println(n);
                System.out.println(String.format("%02X ", n));
            }
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
        }

        String s =  Integer.toHexString(-71);
        System.out.println(s);
        System.out.println(String.format("%02X ", -71));

        byte[] aaa = "a".getBytes();
        System.out.println(aaa);
    }

    private static void fun2() throws UnsupportedEncodingException {
        String a = "<e type=\"text_bold\" title=\"6%E3%80%81%E8%BF%9B%E5%85%A5%E7%94%9F%E8%B4%A2%E3%80%81%E7%A6%BB%E5%BC%80%E7%94%9F%E8%B4%A2%E3%80%81%E5%9B%9E%E5%BD%92%E7%94%9F%E8%B4%A2\" />";
        String b= URLDecoder.decode(a,"utf-8");
        System.out.println(b);
        String c  ="进入生财";
        String d = URLEncoder.encode(c,"utf-8");
        System.out.println(d);
        String e = "国";
       /*byte[] f = e.getBytes("utf-8");
       System.out.println(f);*/
        String h = "abc";
        System.out.println(URLEncoder.encode(e,"GBK"));
    }

    private static void funa() {
        List list = new ArrayList();
        list.add("ttt");
        list.add("gg");
        System.out.println(list);
        NfzmArticle article = new NfzmArticle();
        article.setNextId("ggg");
        //Thread.sleep(5000000);

        Integer a1 =56;
        Integer a2 = 56;
        System.out.println(a1==a2);

        Integer a3 = new Integer(56);
        Integer a4 = new Integer(56);
        System.out.println(a4==a3);
    }
}
